package com.dau.entity.customer;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dau.entity.BaseEntity;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.math.BigDecimal;
import java.util.List;

@TableName("customer_order_info")
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class OrderInfo extends BaseEntity {
    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 订单id
     */
    @TableId(value = "order_id")
    private Long orderId;
    /**
     * 订单代码
     */
    private String orderCode;
    /**
     * 订单金额
     */
    @NotNull(message = "订单金额不能为空")
    private BigDecimal orderAmount;
    /**
     * 客户id
     */
    private Long customerId;
    /**
     * 客户名称
     */
    private String customerName;
    /**
     * 客户vx id
     */
    private String customerVxId;
    /**
     * 优惠券id
     */
    private String couponId;
    /**
     * 优惠券金额
     */
    private BigDecimal couponAmount = BigDecimal.ZERO;
    /**
     * 优惠券类型
     */
    private String couponType;
    /**
     *   status 状态 -1 超时取消 0未支付 1支付中 2取消支付 3支付成功 4备货中 5发货中 6订单完成  7退单中 8退单结束
     */
    /**
     * 订单详情列表
     */
    @TableField(exist = false)
    @Valid
    private List<ItemInfo> itmeList;
}
